package com.example.safeassistan.my.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;
import com.example.safeassistan.my.model.FeedBackListModel;

import java.util.List;


public class FeedBackListAdapter extends BaseQuickAdapter<FeedBackListModel.ResultDTO.RecordsDTO, BaseViewHolder> {


    public FeedBackListAdapter(List<FeedBackListModel.ResultDTO.RecordsDTO> data) {

        super(R.layout.item_feedback_list, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FeedBackListModel.ResultDTO.RecordsDTO item) {
        TextView tvStstus=helper.getView(R.id.tvStstus);

        helper.setText(R.id.llCreateTime,item.getCreateTime());
        helper.setText(R.id.tvPublishName,item.getRealname());
        helper.setText(R.id.tvDepartName,item.getDepartName());
        if (item.getDisposeResult()==0){
            tvStstus.setText("未处理");
            tvStstus.setBackgroundResource(R.drawable.stoke_orange_bg);
            tvStstus.setTextColor(mContext.getResources().getColor(R.color.orange));
        }else {
           tvStstus.setText("已处理");
            tvStstus.setBackgroundResource(R.drawable.stoke_green_bg);
            tvStstus.setTextColor(mContext.getResources().getColor(R.color.green));
        }

    }
}
